/*eslint-disable*/
const path = require('path')
const express = require('express')
var proxy = require('http-proxy-middleware')
const url = require('url')
const app = express()

var apiProxy = proxy('/api', {
  target: 'http://pp-api.douxuejiaoyu.com',
  changeOrigin: true
})

app.use('/', apiProxy)
app.get('/', (req, res) => {
  res.redirect('http://localhost:3000/pages/examCenter/topic.html')
})

app.use('/', express.static(__dirname))

app.listen(3000, () =>
  console.log('Example app listening http://localhost:3000 !')
)
